<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>全选全不选</title>
    <script src="../jquery/jquery-3.3.1.min.js"></script>
    <style>
        table {
            width: 800px;
            margin: auto;
            text-align: center;
            border: 1px solid lightblue;
            padding: 0px;
            box-sizing: border-box;
            margin-top: 50px;
        }

        th, td {
            border: 1px solid lightblue;
            height: 30px;
        }

        th {
            background-color: #30869A;
        }
    </style>
    <script>
        $(function () {
            $("#all").click(function () {
                $("input[type='checkbox']").prop("checked", this.checked);
            });
        });
    </script>
</head>
<body>
<table cellspacing="0">
    <caption>西瓜便利店3月份库存统计</caption>
    <tr>
        <th><input id="all" type="checkbox"/></th>
        <th>序号</th>
        <th>物品名称</th>
        <th>物品单位</th>
        <th>入库总计</th>
        <th>出库总计</th>
        <th>剩余库存</th>
    </tr>
    <tr>
        <td><input type="checkbox"/></td>
        <td>1</td>
        <td>花生油</td>
        <td>瓶</td>
        <td>280</td>
        <td>41</td>
        <td>239</td>
    </tr>
    <tr>
        <td><input type="checkbox"/></td>
        <td>2</td>
        <td>苹果</td>
        <td>箱</td>
        <td>22</td>
        <td>1</td>
        <td>21</td>
    </tr>
    <tr>
        <td><input type="checkbox"/></td>
        <td>3</td>
        <td>奥利奥</td>
        <td>包</td>
        <td>12</td>
        <td>10</td>
        <td>2</td>
    </tr>
    <tr>
        <td><input type="checkbox"/></td>
        <td>4</td>
        <td>啤酒</td>
        <td>箱</td>
        <td>10</td>
        <td>4</td>
        <td>6</td>
    </tr>
    <tr>
        <td><input type="checkbox"/></td>
        <td>5</td>
        <td>方便面</td>
        <td>桶</td>
        <td>100</td>
        <td>23</td>
        <td>77</td>
    </tr>
    <tr>
        <td><input type="checkbox"/></td>
        <td>6</td>
        <td>火腿肠</td>
        <td>袋</td>
        <td>10</td>
        <td>1</td>
        <td>9</td>
    </tr>
    <tr>
        <td><input type="checkbox"/></td>
        <td>7</td>
        <td>纯净水</td>
        <td>瓶</td>
        <td>50</td>
        <td>41</td>
        <td>9</td>
    </tr>
    <tr>
        <td><input type="checkbox"/></td>
        <td>8</td>
        <td>大米</td>
        <td>袋</td>
        <td>12</td>
        <td>5</td>
        <td>7</td>
    </tr>
    <tr>
        <td><input type="checkbox"/></td>
        <td>9</td>
        <td>五花肉</td>
        <td>斤</td>
        <td>50</td>
        <td>46</td>
        <td>4</td>
    </tr>
    <tr>
        <td><input type="checkbox"/></td>
        <td>10</td>
        <td>白菜</td>
        <td>斤</td>
        <td>300</td>
        <td>260</td>
        <td>40</td>
    </tr>

</table>
</body>
</html>